package com.aos.erp.fs.web.rest;

import com.aos.erp.common.bean.PageBean;
import com.aos.erp.common.bean.ResultEntity;
import com.aos.erp.fs.model.SysFile;
import com.aos.erp.fs.service.SysFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Slf4j
@RestController("RestSysFileController")
@RequestMapping("/api/file")
@Api("管理api")
public class SysFileController {

    @Resource
    private SysFileService fileService;

    @GetMapping("/list")
    @ApiOperation(value = "分页查询")
    public ResultEntity<PageBean<SysFile>> queryPageBean(@RequestParam(name = "pageIndex", defaultValue = "1") int pageIndex, @RequestParam(name = "pageSize", defaultValue = "20") int pageSize,
                                                         String appId, String userId) {
        return ResultEntity.success(fileService.queryByPage(pageIndex, pageSize, appId, userId));
    }


}
